<?php
include_once('common/header.php');	
if($AppUI->id <= 0 || !isset($_SERVER['HTTP_REFERER'])) {	
	$arrJson = array('error'=>1,'msg'=>$arrError[1]);
	echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
	exit();
}
$intPlaceId = $objRequest->getParam('placeid', 0);
$intType	= $objRequest->getParam('type', 0);
$this->view->intPlaceId = $intPlaceId;
$this->view->intType	= $intType;
$objView 	= Zend_Registry::get('objView');
if($intType == 1) {
	$objPlace	= new Place();
	include_once('place/images.php');
	$objView	= Zend_Registry::get('objView');
	$strData	= $objView->fetch('place/box-image.tpl');
	$strImgFull	= $objView->fetch('place/box-image-full.tpl');
	$arrJson 	= array('error'=> 0, 'dhtml'=>$strData, 'dfull'=>$strImgFull);
}elseif($intType == 2){
	$intPimageId 		= $objRequest->getParam('pimageid', 0);
	$objPlace			= new Place();
	$this->view->info	= $objPlace->getImage($intPimageId);
	$objView	= Zend_Registry::get('objView');
	$strData	= $objView->fetch('place/box-image-full.tpl');
	$arrJson 	= array('error'=> 0, 'dhtml'=>$strData);
}elseif($intType == 3) {
	$intPimageId 	= $objRequest->getParam('pimageid', 0);
	$objPlace		= new Place();
	$intError		= $objPlace->addLikeImage($AppUI->id, $intPlaceId, $intPimageId, $intLike);
	if($intError == 0) {
		$strMessage	= $arrMessage[23];
	}else {
		$strMessage	= $arrError[$intError+61];
	}
	$arrJson 	= array('error'=> $intError, 'msg'=>$strMessage, 'like' => Vfriend_Function::numberFormat($intLike));
	
}else {
	$strData	= $objView->fetch('place/ui-image.tpl');
	$arrJson 	= array('error'=> 0, 'dhtml'=>$strData);
}
echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
exit();
?>
